﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%@ Import Namespace="ChoViet.CMS.Models" %>
<%@ Import Namespace="ChoViet.Lib.Common" %>
<%@ Import Namespace="ChoViet.CMS.Components" %>
<div id="content">
    <div class="top_left">
        <ul id="menu">
            <li class="active"><a class="home" href="<%=LinkUtils.domain%>">&nbsp;&nbsp;&nbsp;</a></li>
            <li><a href="<%=LinkUtils.UrlAdIndexDefault("ban","","","","",0)%>"><span>Cần bán</span></a></li>
            <li><a href="<%=LinkUtils.UrlAdIndexDefault("cho-thue","","","","",0)%>"><span>Cho thuê</span></a></li>
            <li><a href="<%=LinkUtils.UrlAdIndexDefault("can-mua","","","","",0)%>"><span>Cần mua</span> </a></li>
            <li><a href="<%=LinkUtils.UrlAdIndexDefault("can-thue","","","","",0)%>"><span>Cần thuê</span> </a></li>
            <li class="current"><a href="#">Hiện tại bạn ở Thái Nguyên</a></li>
            <li class="chondiadanh"><a href="#"><span>Chọn Tỉnh khác</span></a>
            <div class="selectprovice">
                <table>
                    <tr class="topcity">
                        <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","hanoi","","",0)%>">TP Hà Nội</a></td>
                        <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","haiphong","","",0)%>">TP Hải Phòng</a></td>
                        <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","thainguyen","","",0)%>">TP Thái Nguyên</a></td> 
                        <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","danang","","",0)%>">TP Đà Nẵng</a></td>
                        <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","tphcm","","",0)%>">TP Hồ Chí Minh</a></td>
                    </tr>
                    <tr class="nomalcity">
                        <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","bacninh","","",0)%>">Bắc Ninh</a></td>
                        <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","haiduong","","",0)%>">Hải Dương</a></td>
                        <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","tuyenquang","","",0)%>">Tuyên Quang</a></td>
                        <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","hue","","",0)%>">Thừa Thiên Huế</a></td>
                        <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","bariavung tau","","",0)%>">Bà Rịa Vũng Tàu</a></td>
                    </tr>
                    <tr class="nomalcity">
                       <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","hungyen","","",0)%>">Hưng Yên</a></td>
                       <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","namdinh","","",0)%>">Nam Định</a></td>
                       <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","hagiang","","",0)%>">Hà Giang</a></td>
                        <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","khanhhoa","","",0)%>">Khánh Hòa</a></td>
                        <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","binhduong","","",0)%>">Bình Dương</a></td>  
                    </tr> 
                     <tr class="nomalcity">
                        <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","vinhphuc","","",0)%>">Vĩnh Phúc</a></td>
                        <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","thaibinh","","",0)%>">Thái Bình</a></td>
                        <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","backan","","",0)%>">Bắc Kạn</a></td>
                        <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","gialai","","",0)%>">Gia Lai</a></td>
                        <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","dongnai","","",0)%>">Đồng Nai</a></td>  
                    </tr>  
                    <tr class="nomalcity">
                       <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","bacgiang","","",0)%>">Bắc Giang</a></td>
                       <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","ninhbinh","","",0)%>">Ninh Bình</a></td>
                       <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","langson","","",0)%>">Lạng Sơn</a></td>
                       <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","nghean","","",0)%>">Nghệ An</a></td>                        
                       <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","phuyen","","",0)%>">Phú Yên</a></td>
                    </tr>
                    <tr class="nomalcity">
                        <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","hoabinh","","",0)%>">Hòa Bình</a></td>
                        <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","thanhhoa","","",0)%>">Thanh Hóa</a></td>
                        <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","dienbien","","",0)%>">Điện Biên</a></td>
                        <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","hatinh","","",0)%>">Hà Tĩnh</a></td>
                        <td><a href="<%=LinkUtils.UrlAdIndexDefault("","","cantho","","",0)%>">TP Cần Thơ</a></td>
                    </tr>
                </table>
                </div>
             <li><a href="#" onclick="AjaxChangeCurrentCountry(1);"><span>Việt Nam</span> </a></li>
             <li><a href="#" onclick="AjaxChangeCurrentCountry(2);"><span>Australia</span> </a></li>
            </li>
        </ul>
    </div>
    <div class="top_right">
        <ul id="menuright">
            <li><a class="dangtin" href="/Đăng tin rao vặt/">Đăng tin </a></li>
            <%
                var usbase = new BaseAuthentication();
                var currus = usbase.CurrentUser;
                if (Page.User.Identity.IsAuthenticated && currus != null)
                {
                    %>
                     <img width="16" height="16" src="http://nuivang.com//templates/nuivang/images/user_edit.png">
                     Thành viên: <a id="a_username" href="#"><%=currus.UserName%></a>
                     <div id="divLogout" style="display: none;  left: 862.5px;  top: 32px;">
	                    <div class="logoutClose" id="logoutClose">&nbsp;</div>
	                    <%if (!string.IsNullOrEmpty(currus.AvataPath))
                       { %> <div style="float:right;padding-top:10px;"><img width="90px" height="60px" src="<%=!String.IsNullOrEmpty(currus.AvataPath) ? currus.AvataPath : "/Images/noavatar.gif" %>" style="border: 1px solid #FF9600; boder-radius:4px;"></div><%} %>
	                    <ul>
		                    <li><img src="/Images/icon-product.png" /><a href="<%=LinkUtils.domain%>/User/Usermanage">Quản lý tin đã đăng</a></li>
		                    <li><img src="/Images/icon-profile.png" /> <a href="<%=LinkUtils.domain%>/User/Usermanage">Thông tin cá nhân</a></li>
		                    <li><img src="/Images/icon-logout.gif" /><a title="Đăng xuất" href="<%=LinkUtils.domain%>/User/LogOut">Đăng xuất</a>
		                    </li>
	                    </ul>
                    </div>   
                  <% 
                }
                else
                {
                 %>
                <li class="active"><a class="dangky" href="/User/Register">Đăng ký</a></li>
                <li><a class="dangnhap" id="lnkLogin" href="#">Đăng nhập</a></li>
            <div id="divLogin" style="left: 877px; top: 32px; display: none;">
	        <div>
	            <div class="inOutlable">Đăng nhập để quản lý tin rao của bạn</div>
	            <div class="loginClose" id="loginClose">&nbsp;</div>
	        </div>
	        <br>
	        <form id="form-login" name="login" method="post" action="/User/LogIn">
		        <table width="100%">
		        <tbody><tr>
			        <td>
				        <label for="modlgn_username">Tên đăng nhập</label>
			        </td>
			        <td>
				        <input type="text" style="width: 122px;" size="18" alt="username" class="inputbox" name="modlgn_username" id="modlgn_username">
			        </td>
		        </tr>
		        <tr>
			        <td>
				        <label for="modlgn_passwd">Mật khẩu</label>
			        </td>
			        <td>
				        <input type="password" style="width: 122px;" alt="password" size="18" class="inputbox" name="modlgn_passwd" id="modlgn_passwd">
			        </td>
		        </tr>
		        <tr>
			        <td align="center" colspan="2">
				        <button tabindex="16" name="btnLogin" type="submit"><span>Đăng nhập</span></button>
				        <input type="hidden" id="url" name="url" value="<%=Request.Url%>"/>
				        <a href="/User/RePass">Bạn quên Mật khẩu?</a>
			        </td>
		        </tr>
		        </tbody>
		       </table>
		   </form>	 
        </div>
            <%} %>
        </ul>
    </div>
</div>
<script type="text/javascript">
    jQuery(function($) {
    
        $("#lnkLogin").click(function(event) {
            event.preventDefault();
            var loginForm = $("#divLogin");

            var fwidth = loginForm.outerWidth(true);
            var bodyWidth = document.body.clientWidth;

            var top = 32;
            var left = bodyWidth / 2 + 500 - fwidth;

            $("#divLogin").css({ left: left, top: top });
            $("#divLogin").slideDown('slow');
        });

        $("#a_username").click(function(event) {
            event.preventDefault();
            var loginForm = $("#divLogout");

            var fwidth = loginForm.outerWidth(true);
            var bodyWidth = document.body.clientWidth;

            var top = 32;
            var left = bodyWidth / 2 + 500 - fwidth;

            $("#divLogout").css({ left: left, top: top });
            $("#divLogout").slideDown('slow');
        });
        $("#logoutClose").mouseout(function(event) {
          event.preventDefault();
            $("#divLogout").hide();
        
        });

        $('#logoutClose').click(function(event) {
            event.preventDefault();
            $("#divLogout").hide();
        });
        $('#loginClose').click(function(event) {
            event.preventDefault();
            $("#divLogin").hide();
        });
    });
</script>
